cmake_minimum_required (VERSION 2.8)
project (SagittariusSandbox)

#add_executable(inf inf.c)
#target_link_libraries(inf sagittarius)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
#add_executable(futex_wait_wake futex_wait_wake.c)
#target_link_libraries(futex_wait_wake sagittarius asmlib)
#add_executable(rwfutex_test rwfutex_test.c)
#target_link_libraries(rwfutex_test sagittarius asmlib)
#add_executable(gettid-demo gettid-demo.c)
#add_executable(sysclone_test sysclone_test.c)
if(NOT ${WIN32})
add_executable(multisema_test multisema_test.c)
target_link_libraries(multisema_test sagittarius asmlib)
endif()
if(${WIN32})
    add_executable(spawn_thread spawn_thread.c)
    target_link_libraries(spawn_thread sagittarius asmlib)
endif()


#set(P_ASM_SRCFILES ${CMAKE_CURRENT_SOURCE_DIR}/interface.s ${CMAKE_CURRENT_SOURCE_DIR}/sysclone.s)
#set(P_ASM_OUTFILES ${CMAKE_CURRENT_BINARY_DIR}/interface.o ${CMAKE_CURRENT_BINARY_DIR}/sysclone.o)
#add_library(asminf STATIC EXCLUDE_FROM_ALL ${P_ASM_OUTFILES})
#set_source_files_properties(${P_ASM_OUTFILES} PROPERTIES EXTERNAL_OBJECT true GENERATED true)
#set_target_properties(asminf PROPERTIES LINKER_LANGUAGE C ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
#add_custom_command(OUTPUT interface.o COMMAND yasm -f elf64 -o interface.o ${CMAKE_CURRENT_SOURCE_DIR}/interface.s DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/interface.s)
#add_custom_command(OUTPUT sysclone.o COMMAND yasm -f elf64 -o sysclone.o ${CMAKE_CURRENT_SOURCE_DIR}/sysclone.s DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sysclone.s)

#target_link_libraries(inf sagittarius asminf)
#target_link_libraries(sysclone_test sagittarius asminf)
